const BaseHandler = require('../base-handler');
const SystemServices = require('../../../constants').SystemServices;
const HTTP_VERBS = require('../../../constants').HTTP_VERBS;
const moment = require('moment');

class GoodsListHandler extends BaseHandler {
    get pattern() {
        return "/activity/list/:type";
    }

    // 获取列表
    doGET(request, response) {
        
    }
    doPOST(request, response) {
        var data = request.body;
        // 传入需要的数据
        data = {
            data: {
                type:4,
                storeNo: 'B02S0002'
            }
        };
        this.Controller.getAcList(data, (result) => {
            if (result.error) {
                return response.json({
                    success: false,
                    error: result.error
                });
            }
            response.json({
                success: true,
                result: result
            });

        });
    }

    setup() {
        this.registerVerb(HTTP_VERBS.GET, this.doGET);
        this.registerVerb(HTTP_VERBS.POST, this.doPOST);
    }
}

module.exports = GoodsListHandler;